  
	<#include "../common/com.html"  /> <@layout>
<head>
    <!-- page specific plugin styles -->
    <link rel="stylesheet" href="${ctx}/static/assets/css/ui.jqgrid.css" />
    <!-- ace styles -->
    <script src="${ctx}/static/inc/platform/js/ajax.js"></script>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/cbb/artDialog/skins/blue.css">
    <script src="${ctx}/static/cbb/artDialog/jquery.artDialog.js"></script>
</head>
    
<body>

<div class="page-content">
	 <div class="row-fluid">
        <div class="span12">
            <!-- PAGE CONTENT BEGINS -->
            <table id="grid-table"></table>
            <div id="grid-pager"></div>
            <!-- PAGE CONTENT ENDS -->
        </div><!-- /.span -->
    </div><!-- /.row-fluid -->
</div><!-- /.page-content -->
<!-- page specific plugin scripts -->


<#include  "../common/end.html"  /> 

<script type="text/javascript">

jQuery(function($) {

    //  jqgrid
    var grid_selector = "#grid-table";
    var pager_selector = "#grid-pager";
    var start=$("#start").val();


    jQuery(grid_selector).jqGrid({
        datatype: "json", //将这里改为使用JSON数据
        mtype:"POST",
        postData:{}, //发送数据
        url:'${ctx}/tbMeetTeacher/showClass/${teacherid}',
        height: '90%',
        footerrow:false,  //合计数据
        colNames:[
                  '会议', '课程',  '状态',''],
        colModel:[
		    {name:'meettitle', width:80,sortable:false},
		    {name:'title', width:80,sortable:false},
		    {name:'status', width:60,sortable:false,formatter: show_status},
            {name:'id',index:'',hidden:true,width:50,sortable:false}
        ],
        rownumbers:true,//添加左侧行号
        sortname: 'id',
        sortable: false,
        viewrecords: true, //是否显示行数
        rowNum:20,
        rowList:[10,20,30],
        loadtext: '正在加载数据...',
        loadui : 'block',
        pager : pager_selector,
        altRows: true,
        shrinkToFit: true,
        //toppager: true,
//
//        multiselect: true,
//        //multikey: "ctrlKey",
//        multiboxonly: true,

       loadComplete : function() {
            var table = this;
            setTimeout(function(){
                updatePagerIcons(table);
            },
                    0);
        } ,
//        ondblClickRow: openview,
//
        caption: "课程" ,
        autowidth: true
    });
    
        
});

  
  
	// 展示状态
	function show_status(cellvalue, options, rowdata)
	{
	    if (cellvalue == 1)
	        return '报名中';
	    else if (cellvalue == 2)
	    	return '进行中';
	    else 
	        return '已结束';
	}
    //replace icons with FontAwesome icons like above
    function updatePagerIcons(table) {
        var replacement =
        {
            'ui-icon-seek-first' : 'icon-double-angle-left bigger-150',
            'ui-icon-seek-prev' : 'icon-angle-left bigger-150',
            'ui-icon-seek-next' : 'icon-angle-right bigger-150',
            'ui-icon-seek-end' : 'icon-double-angle-right bigger-150'
        };
        $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function(){
            var icon = $(this);
            var $class = $.trim(icon.attr('class').replace('ui-icon', ''));

            if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
        })
    }

    function enableTooltips(table) {
        $('.navtable .ui-pg-button').tooltip({container:'body'});
        $(table).find('.ui-pg-div').tooltip({container:'body'});
    }


	window.onresize = function  _doResize() {
	    var ss = pageSize();
	    $("#grid-table").jqGrid('setGridWidth', ss.WinW-10).jqGrid('setGridHeight', ss.WinH-200);
	}

	function pageSize() {
	    var winW, winH;
	    if(window.innerHeight) {// all except IE
	        winW = window.innerWidth;
	        winH = window.innerHeight;
	    } else if (document.documentElement && document.documentElement.clientHeight) {// IE 6 Strict Mode
	        winW = document.documentElement.clientWidth;
	        winH = document.documentElement.clientHeight;
	    } else if (document.body) { // other
	        winW = document.body.clientWidth;
	        winH = document.body.clientHeight;
	    }  // for small pages with total size less then the viewport
	    return {WinW:winW, WinH:winH};
	}


</script>

</body>
 </@layout> 
